import { Route, withRouter, Switch } from "react-router-dom"
import { routes} from './router'
import React, { Component } from 'react'
import MenuBar from './components/MenuBar'
const style = {
  position:"fixed",
  bottom:0,
  width:"100%",
  height:"1rem",
  display:"grid",
  gridTemplateColumns: "25% 25% 25% 25%",
  justifyItems:"center",
  alignItems:'center',
  background:"#fff",
}
const pageList=[{
  path: '/',
  name:"首页"
},
{
  path: '/Guarantee',

  name:"担保预售"
},
{
  path: '/Community',
  name:"社区"
},

{
  path: '/Mine',
  name:"我的"
}]
const style2={
  position:'fixed',
  bottom:0,
  left:0
}
class App extends Component {

  render() {
    let { pathname } = this.props.location
    return (
      
      <div>
        {
          routes.map((el, i) => <Route key={i} path={el.path} component={el.component} exact={el.isExact}></Route>)
        }
       
      
        {
          pageList.some(el=>pathname == el.path) && <MenuBar></MenuBar>
        }
       
      </div>
      
    )

  }

}

export default withRouter(App);
